#博客编辑
import time

from selenium.webdriver.common.by import By
from selenium.webdriver.common.devtools.v94.css import set_local_fonts_enabled

from common.Utils import BlogDriver
class BlogEdit:
    url=""
    driver=""

    def __init__(self):
        self.url="http://8.137.19.140:9090/blog_edit.html"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)
    def EditRigText(self):
 #发布博客
     time.sleep(3)
     self.driver.find_element(By.CSS_SELECTOR,"#title").send_keys("第一遍测试")
 #非法点击
     #self.driver.find_element(By.CSS_SELECTOR,"#editor > div.editormd-toolbar > div > ul > li:nth-child(12) > a > i").click()
     #发布文章
     time.sleep(3)
     self.driver.find_element(By.CSS_SELECTOR,"#submit").click()
     txe = self.driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div:nth-child(1433) > div.title").text
     print(txe)
# assert txe =="第一遍测试"

